import React, { Component } from 'react';
import { Swiper } from "antd-mobile";
import "../styles/MySwiper.css"
class MySwiper extends Component {
    constructor(props) {
        super(props)
        this.state = {

        }
    }
    render() {
        return (
            <div className='swiper'>
                <Swiper loop autoplay autoplayInterval={3000}>
                    {this.props.swiperlist.map((item, index) => {
                        return (
                            <Swiper.Item key={index}>
                                <img src={item} alt="" />
                            </Swiper.Item>
                        )
                    })}
                </Swiper>
            </div>
        );
    }
}
//类型验证
// MySwiper.propTypes = {
//     swiperlist:{ type: PropTypes.array, default:[] }
// }
export default MySwiper;